//
//  UserViewController.m
//  Cease
//
//  Created by Deepak Kumar on 8/19/13.
//  Copyright (c) 2013 Home. All rights reserved.
//

#import "UserViewController.h"

@interface UserViewController ()

@end

@implementation UserViewController
@synthesize mCarousel, mDelegate;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
}



#pragma mark -
#pragma mark iCarousel methods

- (float)carouselItemWidth:(iCarousel *)carousel
{
    //slightly wider than item view
    return 150.0f;
}

- (NSUInteger)numberOfItemsInCarousel:(iCarousel *)carousel
{
	return 5;
}

- (UIView *)carousel:(iCarousel *)carousel viewForItemAtIndex:(NSUInteger)index
{	
	UIView *tView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];
	tView.backgroundColor = [UIColor whiteColor];
    
    
    // border radius
    [tView.layer setCornerRadius:50.0f];
    
    // border
    [tView.layer setBorderColor:[UIColor whiteColor].CGColor];
    [tView.layer setBorderWidth:3.0f];
    
    // drop shadow
    [tView.layer setShadowColor:[UIColor blackColor].CGColor];
    [tView.layer setShadowOpacity:0.8];
    [tView.layer setShadowRadius:3.0];
    [tView.layer setShadowOffset:CGSizeMake(2.0, 2.0)];
        
	//UIImageView *tImageView = [[UIImageView alloc] initWithFrame:CGRectMake(10.0f, 10.0f, 512.0f, 384.0f)];
    //tImageView.contentMode = UIViewContentModeScaleAspectFill;
    //tImageView.clipsToBounds = YES;
    
	//File *tFile = [mFileArray objectAtIndex:index];
    //[tImageView setImage:[UIImage  imageWithContentsOfFile:tFile.mFilePath]];
    
	//[tView addSubview:tImageView];
	
    /*
     UIImageView *glossyImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0.0f, -20.0f, 512.0f, 150.0f)];
     [glossyImageView setImage:[UIImage imageNamed:@"bg_glossy.png"]];
     [glossyImageView setAlpha:0.6];
     [tView addSubview:glossyImageView];
     */
    
	//tFileName = [mFilePath stringByAppendingPathComponent:tFileName];
	//NSLog(@"tFileName:%@", tFileName);
	tView.backgroundColor = [UIColor greenColor];
	return tView;
}

- (BOOL)carouselShouldWrap:(iCarousel *)carousel
{
    //wrap all carousels
    return NO;
}

- (void)carouselCurrentItemIndexUpdated:(iCarousel *)carousel {
    
	//mCurrentItemIndex = carousel.currentItemIndex;
	
}


#pragma mark item clicked
- (void)itemClicked :(iCarousel *)_carousel atIndex:(NSUInteger)index atPoint:(CGPoint)pPoint
{
    NSLog(@"_itemClicked:%d", index);
    [mDelegate userViewController:self user:YES];
}



- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
